package com.songlanyun.modules.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.songlanyun.common.drive.IBaseService;
import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.modules.comment.model.dto.OrderGoodsCommentDTO;
import com.songlanyun.modules.order.entity.ChildOrder;
import com.songlanyun.modules.order.entity.Order;
import com.songlanyun.modules.order.model.vo.ChildOrderSlimVO;
import com.songlanyun.modules.order.model.vo.ChildOrderVO;
import com.songlanyun.modules.order.model.vo.SubmitChildOrderVo;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 销售系统中的子订单
 *
 * @author lubo
 * @email sunlightcs@gmail.com
 * @date 2020-11-16 14:14:42
 */
public interface ChildOrderService extends IBaseService<Long,ChildOrder> {

    ChildOrder create(Order order, SubmitChildOrderVo dto);

    ChildOrder loadByOrderAndChildId(Long orderId,Long id,boolean tw);

    ChildOrder loadByOrderAndThirdSkuId(Long orderId,Long thirdSkuId,boolean tw);

    ChildOrder refundOperate(ChildOrder childOrder);

    Integer getBuyGoodsCount(Long userId,Long goodsId,Integer marketingType);

    List<ChildOrder> needAutoEndOrder();

    List<ChildOrder> needAutoCommentOrder();

    void autoCommentChildOrder(ChildOrder childOrder);

    void commentChildOrder(OrderGoodsCommentDTO dto);

    void endChildOrder(ChildOrder childOrder);

    void endChildOrderSync(ChildOrder childOrder);

    void commentChildOrderSync(ChildOrder childOrder);

    List<ChildOrderVO> vosByOrderId(Long id);

    List<ChildOrderSlimVO> vosSlimByOrderId(Long id);

    void processBatchSingleGoodsStock(List<ChildOrder> childOrderList);

    void updateChildOrder(ChildOrder childOrder);

    BigDecimal getObtainActivationTotalPrice(Long usrId);

    //查询未结算的订单
    List<ChildOrder> selectNotResultChildOrder();


}

